using UnityEngine;
using QFramework;

namespace Projectsurviva
{
	public partial class boom : ViewController
	{
        private void OnTriggerEnter2D(Collider2D collision)
        {
            if(collision.GetComponent<Collectcircle>())
            {
                foreach (var item in FindObjectsByType<Enemy>(FindObjectsInactive.Exclude,FindObjectsSortMode.None))
                {
                    if(item.GetComponent<Enemy>())
                    {

                    item.Hurt(item.hp);
                    }
                }
                UiGamepanel.flahsScreen.Trigger();
                AudioKit.PlaySound("_bomb");
                CameraContoller.Shake();
                this.DestroyGameObjGracefully();
            }
        }
    }
}
